package interview.thread;

/**
 * @Author: cctv
 * @Date: 2019/5/17 9:59
 */
public class CycleWait implements Runnable {
    private String value;

    @Override
    public void run() {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        value = "我可以跟你耗一整天";
    }

    public static void main(String[] args) throws InterruptedException {
        CycleWait cw = new CycleWait();

        Thread t = new Thread(cw);
        t.start();
//        while (cw.value == null) {
//            Thread.sleep(100);
//        }
        t.join();
        System.out.println("value:" + cw.value);
    }
}
